﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SiteSetting.aspx.cs" Inherits="Card.Manager.SiteSetting" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>分站配置</title>
    <link href="Css/Style.css" rel="Stylesheet" type="text/css" />

    <script src="JavaScript/jquery-1.8.3.min.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <fieldset>
            <legend>站点配置 </legend>
            <asp:Repeater ID="rptList" runat="server">
                <HeaderTemplate>
                    <table class="TB">
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <table class="TB">
                                <tr>
                                    <td class="TD_Input_Text" style="width: 100px;">
                                        名称
                                    </td>
                                    <td class="TD_Input">
                                        【<asp:Label ID="lblCode" Text='<%# Eval("LOOKUP_CODE") %>' runat="server"></asp:Label>】<%# Eval("VALUE") %>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="TD_Input_Text">
                                        描述
                                    </td>
                                    <td class="TD_Input">
                                        <%# Eval("DESCRIPTION") %>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" class="TD_Input">
                                        <asp:TextBox ID="txtTextValue" runat="server" TextMode="MultiLine" Rows="3" Text='<%# Eval("SETTING_VALUE") %>'
                                            Width="90%"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    <tr>
                        <td>
                            <asp:Button ID="btnSave" CommandName="SAVE" runat="server" Text="保存" />
                        </td>
                    </tr>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </fieldset>
        <fieldset>
            <legend>纸张及价格配置 </legend>
            <p><b>说明：纸张代码和纸张名称以及单价不能为空</b></p>
            <p runat="server" id="copySetting" visible="false"><b>该站点还没配置任何纸张信息，会自动使用系统统默认纸张配置，<asp:LinkButton ID="lbtnShowDefault" 
                    runat="server" Text="点击导入系统配置纸张" onclick="lbtnShowDefault_Click"></asp:LinkButton></b></p>
            <asp:Repeater ID="rptCards" runat="server">
                <HeaderTemplate>
                    <table class="TB">
                    <tr class="TB_Header">
                        <td style="width:30px;">
                            排序
                        </td>
                        <td>
                            名片信息
                        </td>
                        <td>
                            动作
                        </td>
                    </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="TB_Item">  
                        <td rowspan="2">
                            <asp:TextBox ID="txtSort" runat="server" Text='<%# Eval("SORT") %>' MaxLength="4"
                                Width="30px"></asp:TextBox>
                        </td>                      
                        <td>
                            <table class="TB">
                                <tr>
                                    <td class="TD_Input_Text">
                                        纸张代码
                                    </td>
                                    <td>
                                        <asp:Label ID="lblCode" runat="server" Text='<%# Eval("CARD_CODE") %>'></asp:Label>
                                    </td>
                                    <td class="TD_Input_Text">
                                        纸张名称
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCardName" runat="server" Text='<%# Eval("CARD_NAME")%>' MaxLength="20"
                                            CssClass="Input_Middle"></asp:TextBox>
                                    </td>
                                    <td class="TD_Input_Text">
                                        描述
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtDesc" runat="server" Text='<%# Eval("DECRIPTION")%>' MaxLength="50"
                                            CssClass="Input_Middle"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td rowspan="2" align="center">
                            <asp:LinkButton ID="lbtnSave"  CommandName="SAVE" CommandArgument='<%# Eval("CARD_CODE") %>'   runat="server">保存</asp:LinkButton>|
                            <asp:LinkButton ID="lbtnDelete"  CommandName="DELETE" CommandArgument='<%# Eval("CARD_CODE") %>' OnClientClick="javascript:return confirm('删除后不能恢复，确定删除吗？');"  runat="server" Text="删除"></asp:LinkButton>
                        </td>
                    </tr>
                    <tr class="TB_Item">                        
                        <td>
                            <table class="TB">
                                <tr class="TB_Header">
                                    <td align="right">
                                        盒数
                                    </td>
                                    <td>
                                        2盒
                                    </td>
                                    <td>
                                        5盒
                                    </td>
                                    <td>
                                        10盒
                                    </td>
                                    <td>
                                        20盒
                                    </td>
                                    <td>
                                        50盒
                                    </td>
                                    <td>
                                        100盒
                                    </td>
                                </tr>
                                <tr class="TB_Item">
                                    <td class="TD_Input_Text">
                                        单价(元/盒)
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice2" runat="server" CssClass="Input_Short" Text='<%# Eval("P2") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice5" runat="server" CssClass="Input_Short" Text='<%# Eval("P5") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice10" runat="server" CssClass="Input_Short" Text='<%# Eval("P10") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice20" runat="server" CssClass="Input_Short" Text='<%# Eval("P20") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice50" runat="server" CssClass="Input_Short" Text='<%# Eval("P50") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice100" runat="server" CssClass="Input_Short" Text='<%# Eval("P100") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr class="TB_Alter">  
                        <td rowspan="2">
                            <asp:TextBox ID="txtSort" runat="server" Text='<%# Eval("SORT") %>' MaxLength="4"
                                Width="30px"></asp:TextBox>
                        </td>                      
                        <td>
                            <table class="TB">
                                <tr>
                                    <td class="TD_Input_Text">
                                        纸张代码
                                    </td>
                                    <td>
                                        <asp:Label ID="lblCode" runat="server" Text='<%# Eval("CARD_CODE") %>'></asp:Label>
                                    </td>
                                    <td class="TD_Input_Text">
                                        纸张名称
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCardName" runat="server" Text='<%# Eval("CARD_NAME")%>' MaxLength="20"
                                            CssClass="Input_Middle"></asp:TextBox>
                                    </td>
                                    <td class="TD_Input_Text">
                                        描述
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtDesc" runat="server" Text='<%# Eval("DECRIPTION")%>' MaxLength="50"
                                            CssClass="Input_Middle"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td rowspan="2" align="center">
                            <asp:LinkButton ID="lbtnSave" CommandName="SAVE" CommandArgument='<%# Eval("CARD_CODE") %>'  runat="server">保存</asp:LinkButton>|
                            <asp:LinkButton ID="lbtnDelete" runat="server" CommandName="DELETE" CommandArgument='<%# Eval("CARD_CODE") %>' Text="删除"></asp:LinkButton>
                        </td>
                    </tr>
                    <tr class="TB_Alter">                        
                        <td>
                            <table class="TB">
                                <tr class="TB_Header">
                                    <td align="right">
                                        盒数
                                    </td>
                                    <td>
                                        2盒
                                    </td>
                                    <td>
                                        5盒
                                    </td>
                                    <td>
                                        10盒
                                    </td>
                                    <td>
                                        20盒
                                    </td>
                                    <td>
                                        50盒
                                    </td>
                                    <td>
                                        100盒
                                    </td>
                                </tr>
                                <tr class="TB_Item">
                                    <td class="TD_Input_Text">
                                        单价(元/盒)
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice2" runat="server" CssClass="Input_Short" Text='<%# Eval("P2") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice5" runat="server" CssClass="Input_Short" Text='<%# Eval("P5") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice10" runat="server" CssClass="Input_Short" Text='<%# Eval("P10") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice20" runat="server" CssClass="Input_Short" Text='<%# Eval("P20") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice50" runat="server" CssClass="Input_Short" Text='<%# Eval("P50") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice100" runat="server" CssClass="Input_Short" Text='<%# Eval("P100") %>'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <FooterTemplate>
                    <tr class="TB_Item">  
                        <td rowspan="2">
                            <asp:TextBox ID="txtSort" runat="server" Text='0' MaxLength="4"
                                Width="30px"></asp:TextBox>
                        </td>                      
                        <td>
                            <table class="TB">
                                <tr>
                                    <td class="TD_Input_Text">
                                        纸张代码
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCode" runat="server"  MaxLength="20"
                                            CssClass="Input_Middle"></asp:TextBox>
                                    </td>
                                    <td class="TD_Input_Text">
                                        纸张名称
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCardName" runat="server"  MaxLength="20"
                                            CssClass="Input_Middle"></asp:TextBox>
                                    </td>
                                    <td class="TD_Input_Text">
                                        描述
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtDesc" runat="server" MaxLength="50"
                                            CssClass="Input_Middle"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td rowspan="2" align="center">
                            <asp:LinkButton ID="lbtnAdd"  CommandName="ADD"  runat="server">新增</asp:LinkButton>
                        </td>
                    </tr>
                    <tr class="TB_Item">                        
                        <td>
                            <table class="TB">
                                <tr class="TB_Header">
                                    <td align="right">
                                        盒数
                                    </td>
                                    <td>
                                        2盒
                                    </td>
                                    <td>
                                        5盒
                                    </td>
                                    <td>
                                        10盒
                                    </td>
                                    <td>
                                        20盒
                                    </td>
                                    <td>
                                        50盒
                                    </td>
                                    <td>
                                        100盒
                                    </td>
                                </tr>
                                <tr class="TB_Item">
                                    <td class="TD_Input_Text">
                                        单价(元/盒)
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice2" runat="server" CssClass="Input_Short" Text='0' 
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice5" runat="server" CssClass="Input_Short" Text='0' 
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice10" runat="server" CssClass="Input_Short" Text='0'
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice20" runat="server" CssClass="Input_Short" Text='0' 
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice50" runat="server" CssClass="Input_Short" Text='0' 
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtPrice100" runat="server" CssClass="Input_Short" Text='0' 
                                            MaxLength="5"></asp:TextBox>/盒
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </fieldset>
    </div>
    </form>
</body>
</html>

<script type="text/javascript">
function selectSingleRadio(rbtn1,GroupName) {
    $("input[type=radio]").each(function(i){
        if(this.name.substring(this.name.length-GroupName.length)==GroupName)
        {
            this.checked=false;
        }
    })
    rbtn1.checked = true;
}
</script>

